//
//  HomeTopItemView.swift
//  MySwiftProject
//
//  Created by 蓓蕾 on 2021/11/9.
//

import UIKit
import SnapKit

class HomeTopItemView: UIView {
    
    var topImageView : UIImageView!
    
    var titleView : UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI();
        
    }
    
    func setUI()
    {
        topImageView = UIImageView()
        self.addSubview(topImageView)
//        topImageView.snp.makeConstraints { make in
//            make.centerX.equalToSuperview()
//            make.top.equalToSuperview().offset(10)
//        }
        titleView = UILabel()
        self.addSubview(titleView)
        titleView.textAlignment = NSTextAlignment.center
        titleView.textColor = UIColor.hexColor(color: "#333333")
        titleView.font = UIFont.systemFont(ofSize: 12)
//        titleView.snp.makeConstraints { make in
//            make.left.equalToSuperview().offset(5)
//            make.right.equalToSuperview().offset(-5)
//            make.top.equalTo(topImageView.snp_bottom).offset(5)
//        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
